package com.flymobi.service;

import java.util.List;

import com.flymobi.fw.modules.CommonService;
import com.flymobi.po.PindaoRule;
import com.flymobi.util.QL;

public class PindaoRuleService extends CommonService {

	public List<PindaoRule> list(Long pindaoId) {
		return dao.find(PindaoRule.class, QL.HQL.PindaoRule.LIST, new Object[] {pindaoId});
	}
	
	public PindaoRule find(Long pindaoId,Long remoteId) {
		return dao.findSingle(PindaoRule.class, QL.HQL.PindaoRule.FIND, new Object[] {pindaoId,remoteId});
	}
	
	public PindaoRule findRemote(Long pindaoId,Long remoteId) {
		return dao.findSingle(PindaoRule.class, QL.HQL.PindaoRule.SELECTED, new Object[] {pindaoId,remoteId});
	}
	

	public void save(PindaoRule PindaoRule) {
		dao.save(PindaoRule);
	}

	public PindaoRule load(String id) {
		return dao.load(PindaoRule.class, new Long(id));
	}
	
	public PindaoRule get(String id) {
		return dao.get(PindaoRule.class, new Long(id));
	}

	public void delete(String id) {
		dao.delete(this.get(id));
	}

	/**
	 * @param id
	 */
	public void deleteByPindaoId(Long id) {
		dao.executeByHQL(QL.HQL.PindaoRule.DELETE_BY_PindaoID, new Object[]{id});
	}
}
